<?php
/**
 * Ajax操作类
 * @author yaoli<yaoli@pateo.com.cn>
 * @version 1.0 GetUser add by yaoli<yaoli@pateo.com.cn> 
 */
class ajax extends ActionBase {
	
	private $date = null;
	
	function init() {
		
	
	}
	
	/**
	 * 动作
	 *
	 * @see AActionBase::action()
	 */
	public function action() {
		$this->date ['way'] = load_model ( 'way' )->getWay ( $this->date ['page'] ,array('action!'=>'delete'));
		
		$this->date ['count'] = load_model ( 'way' )->getRcount ( array('action!'=>'delete') );
		
		$this->date ['pagecontent'] = fenye ( url ( 'way/action' ) . "&page=", $this->date ['page'] + 1, $this->date ['count'], PERPAGE );
		
		$this->template ();
		$this->template->assign ( $this->date );
		$this->template->display ( 'way.html' );
	}
	public function getWayByWname(){
		if (isset ( $_REQUEST ['way_name'] )) {
			$way = load_model ( 'way' )->searchTable ( array ('name' => $_REQUEST ['way_name'] ) );
			if($way){
				echo json_encode($way);
			}
		}
	}

}
